package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.pojo.City;
import com.zhentao.service.CityService;
import com.zhentao.mapper.CityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author HP
 * @description 针对表【t_city】的数据库操作Service实现
 * @createDate 2025-03-23 19:02:33
 */
@Service
public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements CityService {

    @Autowired
    private CityMapper cityMapper;

    @Override
    public List<City> findByLevel(Integer level) {
        return cityMapper.findByLevel(level);
    }

    @Override
    public List<City> findByCid(Integer cityId) {
        QueryWrapper<City> wrapper = new QueryWrapper<>();
        wrapper.eq("pro_id", cityId);
        return cityMapper.selectList(wrapper);
    }

}




